<nav class="navbar navbar-default nav-justified top_search_nav " role="navigation">
    <div class="pull-left top_icon"><img class="img-rounded img-responsive" src="/images/icon.png"></div>
    <form class="navbar-form pull-left" role="search" action="/search" method="GET">
        <div class="input-group search_input ">
            <input type="text" name="keyword" placeholder="SEARCH" class="form-control input-sm"
                   placeholder="Search"/>
               <span class="input-group-btn">
                   <button type="submit" class="btn btn-default btn-sm">Go</button>
                   </span>
        </div>

    </form>
    <div class="top_nav_right pull-right">
    <ul class=" nav navbar-nav  ">

        <li id="index"><a href="/"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
        <% if(user){ %>
        <li id="user"><a href="/users/<%= user.name %>"><span class="glyphicon glyphicon-user"></span> <%= user.name %>
            </a></li>
        <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown">
                <span class="line glyphicon glyphicon-cog"></span>
                设置</a>
            <ul class="dropdown-menu">
                <li><a href="#">账号设置</a></li>
                <li class="" id="filemanage"><a href="/filemanage"> 文件管理</a></li>
                <li class="divider"></li>
                <li><a href="/logout">退出</a></li>
            </ul>
        </li>
        <li class="" id="post">
            <a href="#" data-toggle="modal" data-target="#postModal">
                <span class="glyphicon glyphicon-edit"></span> 发表</a>
        </li>
        <% }else { %>
        <li id="login"><a href="/login"><span class="glyphicon glyphicon-user"></span> 登录</a></li>
        <li id="reg"><a href="/reg"><span class="glyphicon glyphicon-pencil"></span> 注册</a></li>
        <% } %>
        <script type="text/javascript">
            $('ul.nav > li').removeClass('active');
            $('#' + '<%=type%>').addClass('active');
        </script>
    </ul>
    </div>
</nav>
<% include postModel.ejs%>

